<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>数据表模板管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/ins/insTableTemplate/">数据表模板列表</a></li>
		<shiro:hasPermission name="ins:insTable:edit"><li><a href="${ctx}/ins/insTableTemplate/form">数据表模板添加</a></li></shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="insTableTemplate" action="${ctx}/ins/insTableTemplate/" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>主名称：</label>
				<form:input path="name" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li><label>次名称：</label>
				<form:input path="fullName" htmlEscape="false" maxlength="64" class="input-medium"/>
			</li>
			<li><label>分类：</label>
				<sys:treeselect id="parent" name="category.id" value="${insTableTemplate.category.id}" labelName="category.name" labelValue="${insTableTemplate.category.name}"
					title="父级分类" url="/ins/insCategory/treeData" extId="${category.id}" cssClass="" allowClear="true"/>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>主名称</th>
				<th>次名称</th>
				<th>分类</th>
				<th>修改日期</th>
				<th>创建人</th>
				<!-- <th>模板</th> -->
				<shiro:hasPermission name="ins:insTable:edit"><th>操作</th></shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${page.list}" var="insTableTemplate">
			<tr>
				<td>
					${insTableTemplate.name}
				</td>
				<td>
					${insTableTemplate.fullName}
				</td>
				<td>
					${insTableTemplate.category.name}
				</td>
				<td>
					<fmt:formatDate value="${insTableTemplate.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${insTableTemplate.createBy.name}
				</td>
				<%-- <td>
					${insTableTemplate.template.name}
				</td> --%>
				<td>
				<shiro:hasPermission name="ins:insTable:edit">
    				<a href="${ctx}/ins/insTableTemplate/form?id=${insTableTemplate.id}">修改</a>
					<a href="${ctx}/ins/insTableTemplate/delete?id=${insTableTemplate.id}" onclick="return confirmServicePassword('确定删除该数据表吗？','${fns:getUser().name}',this.href)">删除</a>
   					<%-- <c:choose>
	    				<c:when test="${not empty insTable.template.id}">
		    				<a href="${ctx}/ins/insTable/unbindTemplate?id=${insTable.id}" onclick="return confirmServicePassword('确认要解绑该模板吗？','${fns:getUser().name}', this.href)">解绑模板</a>
	    				</c:when>
	    				<c:otherwise>
		    				<a href="javascript:void(0);" onclick="bind('${insTable.id}');">绑定模板</a>
	    				</c:otherwise>
					</c:choose> --%>
				</shiro:hasPermission>
				<%-- <c:if test="${fns:getUser().id==insTable.createBy.id}">
    				<a href="${ctx}/ins/insTable/toAssignView?id=${insTable.id}" >人员授权</a>
				</c:if> --%>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>